package com.example.android.BluetoothChat.util.provider.player.impl;

import java.util.ArrayList;
import java.util.List;

import com.example.android.BluetoothChat.bean.Player;
import com.example.android.BluetoothChat.listener.NewPlayerFoundListener;
import com.example.android.BluetoothChat.util.provider.IPlayerProvider;

public abstract class APlayerProviderImpl implements IPlayerProvider{

	private List<NewPlayerFoundListener> _newPlayerFoundListenerList = new ArrayList<NewPlayerFoundListener>();
	
	@Override
	public void setNewPlayerFoundListener(List<NewPlayerFoundListener> parListenerList) {
		_newPlayerFoundListenerList = parListenerList;

	}
	@Override
	public void addNewPlayerFoundListener(NewPlayerFoundListener parListener) {
		_newPlayerFoundListenerList.add(parListener);

	}
	
	

	protected void fireNewPlayerFound(Player parPlayer){
		for(NewPlayerFoundListener locListener : _newPlayerFoundListenerList){
			locListener.newPlayerFound(parPlayer);
		}
	}
	
	
}
